package ooExercise.ooday05;

public class EnumDemo {
    public static void main(String[] args) {
        for(int i=0;i<Season.values().length;i++){
            System.out.println("索引"+Season.values()[i].ordinal()+"值："+Season.values()[i]);
        }

        Season b=Season.FRIDAY;
        switch (b){
            case MONDAY:
                System.out.println(b.getName()+"在"+b.getStudy());
                break;
            case TUESDAY:
                System.out.println(b.getName()+"在"+b.getStudy());
                break;
            case WESDAY:
                System.out.println(b.getName()+"在"+b.getStudy());
                break;
            case FRIDAY:
                System.out.println(b.getName()+"在"+b.getStudy());
                break;
            case SUNDAY:
                System.out.println(b.getName()+"在"+b.getStudy());
                break;
            case SATURDAY:
                System.out.println(b.getName()+"在"+b.getStudy());
                break;
            case THURSDAY:
                System.out.println(b.getName()+"在"+b.getStudy());
                break;
        }


        Season s=Season.SUNDAY;
        System.out.println(s.getName()+","+s.getStudy());

        Season[] seasons=Season.values();
        for(int i=0;i<seasons.length;i++){
            System.out.println(seasons[i]);
            System.out.println(seasons[i].getName());
            System.out.println(seasons[i].getStudy());
            System.out.println();
        }
    }
}
